﻿var Accordion = {};

Accordion.Init = function () {
    $('#btnHideAccordionMenu').click(Accordion.ShowHideMenu);
}

Accordion.ShowHideMenu = function (btn) {
    var accordionMenu = $('#accordionMenu');
    var divAccordion = $(accordionMenu).find('.accordion-group');
    var contentDiv = $('#contentDiv');
    var btn = $('#btnHideAccordionMenu');

    var isVisible = $(divAccordion).is(':visible');
    if (isVisible) {
        $(divAccordion).slideUp(1000).fadeOut(1000);
        $(accordionMenu).removeClass().addClass('span1');
        $(contentDiv).removeClass().addClass('span11');
        $(btn).html('&raquo;');
    } else {
        $(divAccordion).slideDown(1000).fadeIn(1000);
        $(accordionMenu).removeClass().addClass('span' + Common.ColumnLeftMenu);
        $(contentDiv).removeClass().addClass('span' + Common.ColumnContent);
        $(btn).html('&laquo;');
    }
}